
var blockerConfig = {};
var prLoaded = new Promise(function(onOk, onFailed) {
    chrome.storage.sync.get({
        "users": [],
        "tips": '<b>***BLOCKED BY Blocker4OxC***</b>',
        "blockImages": "0"
    }, function(result) {
        blockerConfig.blockedUsers = result.users;
        blockerConfig.blockedTips = result.tips;
        blockerConfig.blockedTweetImages = result.blockImages === "1";
        onOk();
    });

});

blockerConfig.save = function () {
    
    chrome.storage.sync.set({
        "users": this.blockedUsers,
        "tips": this.blockedTips,
        "blockImages": this.blockedTweetImages ? "1" : "0"
    });
};

blockerConfig.restore = function () {

    this.blockedUsers = [];
    this.blockedTips = '<b>***BLOCKED BY Blocker4OxC***</b>';
    this.blockedTweetImages = false;

    this.save();
};
